﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FileView.aspx.cs" Inherits="FileView" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        文件名称:<asp:TextBox ID="txtfileName" runat="server" Width="120px"></asp:TextBox>文件类型:<asp:DropDownList
            ID="ddlfileType" runat="server" Width="80px">
        </asp:DropDownList>
        上传人员：
        <asp:DropDownList ID="ddluploadUser" runat="server" Width="80px">
        </asp:DropDownList>
        <asp:Button ID="Btn_Query" runat="server" OnClick="Btn_Query_Click" Text="查询" /><br />
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
            DataKeyNames="fileId" CellPadding="3" CellSpacing="2" DataSourceID="FileInfoDataSource"
            OnRowDataBound="GridView1_RowDataBound" Width="842px">
            <FooterStyle BackColor="#6A5ACD" />
            <RowStyle BackColor="#D6DFF7" ForeColor="#8C4510" />
            <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
            <PagerStyle ForeColor="#FFFFFF" HorizontalAlign="Center" BackColor="#6A5ACD" />
            <HeaderStyle BackColor="#799AE1" Font-Bold="True" />
            <Columns>
                <asp:BoundField DataField="fileName" HeaderText="文件名称" SortExpression="fileName" />
                <asp:BoundField DataField="fileType" HeaderText="文件类型" SortExpression="fileType" />
                <asp:BoundField DataField="uploadTime" HeaderText="上传时间" SortExpression="uploadTime" />
                <asp:BoundField DataField="uploadUser" HeaderText="上传人员" SortExpression="uploadUser" />
                <asp:HyperLinkField DataNavigateUrlFields="filePath" HeaderText="下载" DataNavigateUrlFormatString="{0}"
                    Target="_blank" Text="右键另存" />
                <asp:TemplateField>
                    <HeaderTemplate>
                        <label>
                            删除</label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="lkbDel" Text="删除" runat="server" CommandArgument='<%# Eval("uploadUser").ToString() + ":" + Eval("fileId").ToString()%>'
                            OnClick="lkbDel_Click"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="FileInfoDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT [fileId], [fileName], [fileType], [uploadTime], [uploadUser],[filePath] FROM [fileManage]">
        </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
